//
//  ListCell.m
//  Learn
//
//  Created by cjg on 2018/11/3.
//  Copyright © 2018 cjg. All rights reserved.
//

#import "QupeiyinCell.h"

@implementation QupeiyinCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        [self setupUI];
        [self setSelectionStyle:(UITableViewCellSelectionStyleNone)];
    }
    
    return self;
    
}

- (void)setupUI {
    
    UIView *bgView = [[UIView alloc] init];
    bgView.backgroundColor = COLOR_WHITE;
    bgView.layer.cornerRadius = 15;
    bgView.layer.masksToBounds = YES;
    [self.contentView addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(10);
        make.right.equalTo(self.contentView).offset(-10);
        make.top.bottom.equalTo(self.contentView).offset(0);
    }];

    self.imView = [[UIImageView alloc] init];
    [bgView addSubview:self.imView];
    
    self.titleLB = [[UILabel alloc] init];
    self.titleLB.font = FONT_BODY_16;
    self.titleLB.text = @"配音 张骞";
    self.titleLB.textColor = rgb(51, 51, 51);
    self.titleLB.numberOfLines = 0;
    [bgView addSubview:self.titleLB];
    
    [self.imView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(bgView).offset(10);
        make.bottom.equalTo(bgView).offset(-50);
        make.right.equalTo(bgView).offset(-10);
    }];
    [self.titleLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(bgView).offset(-10);
        make.left.equalTo(bgView).offset(10);
        make.top.equalTo(self.imView.mas_bottom).offset(10);
        make.height.mas_equalTo(30);
    }];
    
}



@end
